package org.example.ch3;

import io.reactivex.rxjava3.core.Observable;

import java.util.concurrent.TimeUnit;

public class Main {
    public static void main(String[] args) throws InterruptedException {
        // 创建基于时间的异步的响应式流
        Observable.interval(1, TimeUnit.SECONDS)
                .subscribe(System.out::println);

        // 等待处理10s之后，关闭主线程，程序退出
        Thread.sleep(10000);
    }
}
